import { IsString, IsEmail, MinLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateUserDto {
  @ApiProperty({ description: '用户邮箱' })
  @IsEmail()
  email: string;

  @ApiProperty({ description: '用户密码' })
  @IsString()
  @MinLength(6)
  password: string;

  @ApiProperty({ description: '用户名称' })
  @IsString()
  name: string;

  @ApiProperty({ description: '家庭ID（可选）' })
  @IsString()
  familyId?: string;
}

export class LoginDto {
  @ApiProperty({ description: '用户邮箱' })
  @IsEmail()
  email: string;

  @ApiProperty({ description: '用户密码' })
  @IsString()
  password: string;
}